﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeExternalCurve2d : OdGeCurve2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeExternalCurve2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeExternalCurve2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeExternalCurve2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeExternalCurve2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeExternalCurve2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeExternalCurve2d() : this(GlobalsPINVOKE.new_OdGeExternalCurve2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExternalCurve2d(OdGeExternalCurve2d source) : this(GlobalsPINVOKE.new_OdGeExternalCurve2d__SWIG_1(OdGeExternalCurve2d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExternalCurve2d(IntPtr pCurveDef, OdGe.ExternalEntityKind curveKind, bool makeCopy) : this(GlobalsPINVOKE.new_OdGeExternalCurve2d__SWIG_2(pCurveDef, (int)curveKind, makeCopy), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExternalCurve2d(IntPtr pCurveDef, OdGe.ExternalEntityKind curveKind) : this(GlobalsPINVOKE.new_OdGeExternalCurve2d__SWIG_3(pCurveDef, (int)curveKind), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isNurbCurve()
		{
			bool result = GlobalsPINVOKE.OdGeExternalCurve2d_isNurbCurve__SWIG_0(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isNurbCurve(OdGeNurbCurve2d nurbCurve)
		{
			bool result = GlobalsPINVOKE.OdGeExternalCurve2d_isNurbCurve__SWIG_1(this.swigCPtr, OdGeNurbCurve2d.getCPtr(nurbCurve));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDefined()
		{
			bool result = GlobalsPINVOKE.OdGeExternalCurve2d_isDefined(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getExternalCurve(SWIGTYPE_p_p_void pCurveDef)
		{
			GlobalsPINVOKE.OdGeExternalCurve2d_getExternalCurve(this.swigCPtr, SWIGTYPE_p_p_void.getCPtr(pCurveDef));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGe.ExternalEntityKind externalCurveKind()
		{
			OdGe.ExternalEntityKind result = (OdGe.ExternalEntityKind)GlobalsPINVOKE.OdGeExternalCurve2d_externalCurveKind(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalCurve2d set(IntPtr pCurveDef, OdGe.ExternalEntityKind curveKind, bool makeCopy)
		{
			OdGeExternalCurve2d result = new OdGeExternalCurve2d(GlobalsPINVOKE.OdGeExternalCurve2d_set__SWIG_0(this.swigCPtr, pCurveDef, (int)curveKind, makeCopy), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalCurve2d set(IntPtr pCurveDef, OdGe.ExternalEntityKind curveKind)
		{
			OdGeExternalCurve2d result = new OdGeExternalCurve2d(GlobalsPINVOKE.OdGeExternalCurve2d_set__SWIG_1(this.swigCPtr, pCurveDef, (int)curveKind), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOwnerOfCurve()
		{
			bool result = GlobalsPINVOKE.OdGeExternalCurve2d_isOwnerOfCurve(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalCurve2d setToOwnCurve()
		{
			OdGeExternalCurve2d result = new OdGeExternalCurve2d(GlobalsPINVOKE.OdGeExternalCurve2d_setToOwnCurve(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalCurve2d Assign(OdGeExternalCurve2d extCurve)
		{
			OdGeExternalCurve2d result = new OdGeExternalCurve2d(GlobalsPINVOKE.OdGeExternalCurve2d_Assign(this.swigCPtr, OdGeExternalCurve2d.getCPtr(extCurve)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
